//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<time_control.h>
///	@path	~/src/engine/xcore
///	@date	2008/03/23
///	@desc	.

#pragma once

#include "xeres.h"

#include "lib/utilities/time.h"

#include "graphics/animation/frame.h"

namespace xeres {

	/*! 
		\class	TimeControl
		\brief	Encapsulates a time control that provides global time in xeres.
	*/
	class TimeControl : public Frame
	{
	protected:

		/// \name Constructor & Destructor
		//@{

		/// \ctor
		TimeControl( void );

		/// \dtor
		~TimeControl( void );

		/*! 
			\brief	Call to update tick time.
		*/
		void UpdateTime( void );

		/*! 
			\brief	Set constant update time.
		*/
		void SetConstantUpdate( float dtime );

		/*!	
			\brief	Set update time scale.
		*/
		void SetUpdateScale( float scale );

		//@}

	public:

		/// \name 'Global' Time Function
		//@{

		/*! 
			\brief	Get rough time.
		*/
		float rough( void );

		/*! 
			\brief	Get accurate time.
		*/
		float accurate( void );

		//@}

	private:

		//@ data

		// time & counter of starting time
		Time			m_birth;
		Counter			m_start;
	};

} // namespace xeres
